<div class="input-group set_value">
    {% if item.type == 0 %}<!-- input value -->
        <span class="input-group-addon input-group-addon-label input-group-addon-label-left" style="width:40%;height:34px;">{{ item.label }}</span>
        <span class="input-group-addon input-group-addon-label input-group-addon-label-right" style="{% if item.unit and not form %}width:40%;{% elif item.unit or not form %}width: 50%;{% else %}width:60%;{% endif %}padding:0;border:0;">
            <input type="text" class="form-control {{ item.web_class_str }}" id="{% if form %}{{ form.web_id }}-{% endif %}{{ item.web_id }}-{{ uuid }}-value" placeholder="{% if item.control_element_options is not None %}{{ item.control_element_options.placeholder }}{% endif %}">
        </span>
        {% if item.unit %}<span class="input-group-addon" style="width: 10%;display: inline-block;height: 34px;">{{ item.unit }}</span>{% endif %}
        {% if not form %}
            <span class="input-group-btn" style="display:inline-block;width:10%;"><!-- display value -->
                <button class="btn btn-default write-task-set set-{{ item.key }}" id="{% if form %}{{ form.web_id }}-{% endif %}{{ item.web_id }}-{{ uuid }}" data-key="{{ item.key }}" data-type="{{ item.item_type}}" type="button" style="width:100%;height:34px;padding-top:0;padding-bottom:0;">set</button>
            </span>
        {% endif %}
    {% elif item.type == 1 %}<!-- display value -->
        <span class="input-group-addon input-group-addon-label">
            <button class="btn btn-default read-task-set set-{{ item.key }}" type="button" data-key="{{ item.key }}" data-type="{{ item.item_type}}" style="width:16px;height:16px;padding:0;margin:0;">
                <span class="glyphicon glyphicon-refresh" data-toggle="tooltip" data-placement="top" title="" data-original-title="Refresh data" style="font-size:10px;vertical-align:text-top;"></span>
            </button>
            <span style="color:red;height:12px;" data-toggle="tooltip" data-placement="top" title="" data-original-title="Very old value (>10 polling interval)" class="glyphicon glyphicon-alert hidden"></span>
            <span style="color:orange;height:12px;" data-toggle="tooltip" data-placement="top" title="" data-original-title="Old value (between 3 and 10 polling interval)" class="glyphicon glyphicon-exclamation-sign hidden"></span>
            {{ item.label }}
        </span>
        <span class="input-group-addon input-group-addon-label control-item type-numeric {{ item.web_class_str }}" id="{% if form %}{{ form.web_id }}-{% endif %}{{ item.web_id }}-{{ uuid }}" data-toggle="tooltip" data-placement="top" title="" data-original-title="" data-html="true">Loading...</span>
    {% endif %}
</div>
